const app = getApp();
Page({
  onLoad(options) {
    let { userid ='' } = options;
    this.getVideoList(userid);
  },

  getVideoList(userid) {
    app.util.request({
      url: 'entry/wxapp/index',
      data: {
        op: 'getReviewList',
        userid,
      },
      module: 'cm_trtc',
      method: 'get',
      success: res => {
        let fileSet = res.data.data&&res.data.data.lists||[];
        this.setData({
          videoList: fileSet,
          defaultVideo: fileSet[0]||[],
        });
      }, 
    });
  },

  playhistory(e) {
    let { id } = e.currentTarget.dataset;
    const { videoList } = this.data;
    id && this.setData({
      defaultVideo: videoList.find(item => item.fileId === id) || {},
    });
  },
});